package com.ay.weixin.config.types;

import javax.servlet.ServletContext;

import org.lizar.Web;


public enum KanFangType {
	 BOOK(1,"预约"),
	 RECOMMAND(2,"推荐");
     private int value;
     private String desc;
     private KanFangType(int value,String desc){
    	 this.value=value;
    	 this.desc=desc;
     }
     public static void loadToAppAttr() {
 		ServletContext context = Web.context;
 		context.setAttribute("kanfang_type_list", values());
 		context.setAttribute("kanfang_type_book", BOOK);
 		context.setAttribute("kanfang_type_recommand", RECOMMAND);
 	}
   
     public static KanFangType getStatus(int status){
    	 switch(status){
    	 case 1:
    		 return BOOK;
    	 case 2:
    		 return RECOMMAND;
    	 }
    	 return BOOK;
     }
	
	public int getValue() {
		return value;
	}


	public void setValue(int value) {
		this.value = value;
	}


	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
